//
//  YWMeterReadingDetailRecordCell.m
//  maintain
//
//  Created by Kyo on 16/8/19.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWMeterReadingDetailRecordCell.h"
#import "YWMacro.h"
#import "Masonry.h"

@interface YWMeterReadingDetailRecordCell()

@end

@implementation YWMeterReadingDetailRecordCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.separatorInset = UIEdgeInsetsMake(0, SCREEN_WIDTH, 0, 0);
        [self setUpSubviews];
    }
    return self;
}

- (UILabel *)contentLabel{
    if (!_contentLabel) {
        UILabel * contentLabel = [[UILabel alloc] init];
        contentLabel.font = kContentFont;
        contentLabel.numberOfLines = 0;
        [self.contentView addSubview:contentLabel];
        _contentLabel = contentLabel;
    }
    return _contentLabel;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.contentLabel.preferredMaxLayoutWidth = self.contentLabel.frame.size.width;
}

- (void)setUpSubviews{
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.contentView).insets(UIEdgeInsetsMake(5, 10, 5, 10));
    }];
}

@end
